import java.util.Scanner;

/**
 * @author Jimmy Zhan WORKSTATION
 * @since 2023/8/20 22:23
 * 说明：回文数
 */

public class ReverseNum {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        System.out.println(isPalindrome(x));
    }
    public static boolean isPalindrome(int x) {
        String str = Integer.valueOf(x).toString();
        int len = str.length();
        if (len == 0 || len == 1) return true;
        int left = 0;
        int right = len - 1;
        while (left < right) {
            if (str.charAt(left) != str.charAt(right)) {
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
